package com.qf.lanzhou.shop.api.dao;

import com.qf.lanzhou.shop.pojo.entity.Goods;
import com.qf.lanzhou.shop.pojo.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author Nerly
 * @Date 2021/1/11 19:22
 * @JDK 1.8
 * @Version 1.0
 */
public interface HistoryMapper {
    /**
     * 根据用户id查找足迹
     *
     * @param user
     * @return
     */
    List<Goods> selectByUserId(User user);

    /**
     * 根据用户id和商品id查找足迹
     *
     * @param user
     * @param goods
     * @return
     */
    Goods selectByUserIdAndGoodsId(@Param("user") User user, @Param("goods") Goods goods);

    /**
     * 根据商品Id删除商品
     *
     * @param goods
     * @param user
     * @return
     */
    int deleteByGoodsId(@Param("user") User user, @Param("goods") Goods goods);

    /**
     * 新增足迹
     *
     * @param user
     * @param goods
     * @return
     */
    int insert(@Param("user") User user, @Param("goods") Goods goods);
}
